<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>使用bootstrap绘制form表单</title>
<!-- Bootstrap core CSS -->
<link
	href="${pageContext.servletContext.contextPath}/static/plugins/bootstrap-3.3.7-dist/css/bootstrap.min.css"
	rel="stylesheet">
<link
	href="${pageContext.servletContext.contextPath}/static/plugins/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css"
	rel="stylesheet">
<!-- bootstrap-datepicker-1.9.0-dist -->
<link
	href="${pageContext.servletContext.contextPath}/static/plugins/bootstrap-datepicker-1.9.0-dist/css/bootstrap-datepicker.min.css"
	rel="stylesheet">

<!-- Bootstrap core JavaScript-->
<!-- Placed at the end of the document so the pages load faster -->
<!--import jquery before bootstrap javascript-->
<script
	src="${pageContext.servletContext.contextPath}/static/plugins/jquery-1.12.4/jquery-1.12.4.min.js"></script>
<script
	src="${pageContext.servletContext.contextPath}/static/plugins/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<!-- bootstrap-datepicker-1.9.0-dist -->
<script
	src="${pageContext.servletContext.contextPath}/static/plugins/bootstrap-datepicker-1.9.0-dist/js/bootstrap-datepicker.min.js"></script>

<script
	src="${pageContext.servletContext.contextPath}/static/plugins/bootstrap-datepicker-1.9.0-dist/locales/bootstrap-datepicker.zh-CN.min.js"></script>



<script type="text/javascript">
	
	
	// ajax进行查询，填充表单标签值
	
	function doAjaxQuery(){
		// 使用ajax进行查询
		$.ajax({
				// 请求类型
			   type: "POST",
				// 请求的url，和form的action属性值一样
			   url: "${pageContext.servletContext.contextPath}/CourseInfoModifyControl",
				// 发送的表单数据，按照如下格式提供即可："name=John&location=Boston"
			   data:  $("#modifyForm").serialize(),
			   // 序列化表单参数，获取一个序列化的字符串，用于ajax请求，必须在form中才可以使用
				//data:new FormData(document.forms[0]),
				// response响应的数据类型，默认是文本类型，可以指定为 xml、html、json等类型
				//dataType:"json",
				// 回调函数
				success: function(data, textStatus, jqXHR){
				// 进行dom操作，局部修改浏览器的显示数据，进行局部刷新数据
				if(data == "ok"){
					alert("保存成功!");
					$(location).attr('href', '${pageContext.servletContext.contextPath}/JumpU?pg=WEB-INF/pages/info/infoQuery.jsp');
					 
				 }else{
					 alert("保存失败!");
				 }
			   }

			});
	}
	
	
	
	
</script>

<style>
#maindiv {
	width: 80%;
	padding-top: 10px;
}
</style>
</head>
<body>
	<div id="maindiv">
		<form id="modifyForm" class="form-horizontal" >
			<!-- 添加隐藏表单域是为了修改使用；将当前修改的记录的主键一并通过form表单传到服务器 -->
			<div class="form-group">
				<label class="col-sm-2 control-label">课程名称</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" id="txtCourseName"
						name="c_Name" placeholder="请输入课程名称">
				</div>

				<label class="col-sm-2 control-label">课程内容</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" id="txtCourseCon"
						name="c_Con"  placeholder="请输入课程内容">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">课程地点</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" id="txtCoursePlace" 					 
						name="c_Place" placeholder="请输入课程地点">
				</div>

				<label class="col-sm-2 control-label">课程日期</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" id="txtCreateDate" 
					name="c_Date" placeholder="请输入课程日期">
				</div>
			</div>		
			<div class="form-group">
				<label class="col-sm-2 control-label">课程时间</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" id="txtCourseTime" 					 
						name="c_Time" placeholder="请输入课程时间">
				</div>
				<input type="hidden" id="t_id" name="t_id" value="${t_Id }">
			</div>	
		</form>
	</div>
</body>
</html>